import request from "@/utils/request"
import store from "@/store"
let cookie = store.state.usercookie
/* 
搜索api

*/
/* 
获取歌单信息
type: 搜索类型；默认为 1 即单曲 , 取值意义 
: 1: 单曲, 10: 专辑, 100: 歌手, 1000: 歌单, 1002: 用户, 1004: MV, 
1006: 歌词, 1009: 电台, 1014: 视频, 1018:综合, 2000:声音(搜索声音返回字段格式会不一样)
 */
export const getsearchAPI = (keywords,limit,offset,type) => {
    return request({
      method: "GET",
      url: "/cloudsearch",
      params: {
        keywords,
        type,
        limit,
        offset,
        cookie
      },
    })
  }
// 搜索建议
  export const getsearchSuggestAPI = (keywords) => {
    return request({
      method: "GET",
      url: "/search/suggest",
      params: {
        keywords,
        cookie
      },
    })
  }
// 搜索建议
export const getsearchdefaultAPI = (keywords) => {
  return request({
    method: "GET",
    url: "/search/default",
    params: {
      keywords,
      cookie
    },
  })
}


//搜索匹配内容
export const getsearchMultimatchAPI = (keywords) => {
  return request({
    method: "GET",
    url: "/search/multimatch",
    params: {
      keywords,
      cookie
    },
  })
}

//搜索热门内容
export const getsearchHotAPI = () => {
  return request({
    method: "GET",
    url: "/search/hot/detail",
    params: {
      cookie
    },
  })
}